﻿@model IList<ProductSpecificationModel>
@using Nop.Core.Domain.Catalog;
@if (Model.Count > 0)
{
    <div class="product-specs-box">
        <div class="title">
            <strong>@T("Products.Specs")</strong>
        </div>
        <div class="table-wrapper">
            <table class="data-table">
                <thead>
                    <tr class="hidden-row">
                        <th width="25%"><span>@T("Products.Specs.AttributeName")</span></th>
                        <th><span>@T("Products.Specs.AttributeValue")</span></th>
                    </tr>
                </thead>
                <tbody>
                    @for (var i = 0; i < Model.Count; i++)
                    {
                        var item = Model[i];
                        <tr @(i % 2 == 0 ? Html.Raw(" class=\"odd\"") : Html.Raw(" class=\"even\""))>
                            <td class="spec-name">
                                @item.SpecificationAttributeName
                            </td>
                            <td class="spec-value">
                                @if (!string.IsNullOrEmpty(item.ColorSquaresRgb) && (item.AttributeTypeId == (int)SpecificationAttributeType.Option) )
                                {
                                    <div class="attribute-squares color-squares">
                                        <span class="attribute-square-container" title="@Html.Raw(item.ValueRaw)">
                                            <span class="attribute-square" style="background-color: @(item.ColorSquaresRgb);">&nbsp;</span>
                                        </span>
                                    </div>
                                }
                                else
                                {
                                    @Html.Raw(item.ValueRaw)
                                }
                            </td>
                        </tr>
                    }
                </tbody>
            </table>
        </div>
    </div>
}